package hot;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lakersUp
 * @Classname
 * @Description     找到数组中小时的数字
 * @Date 2022/4/3 10:03
 * @Version 1.0
 */
public class Hot448findDisappearedNumbers {
    public List<Integer> findDisappearedNumbers(int[] nums){
        int n=nums.length;
        for(int i=0;i<n;i++){
            if(nums[Math.abs(nums[i])-1]>0){
                nums[Math.abs(nums[i])-1]=-nums[Math.abs(nums[i])-1];
            }
        }
        List<Integer> res = new ArrayList<>();
        for(int i=0;i<n;i++){
            if(nums[i]>0){
                res.add(i+1);
            }
        }
        return res;
    }
}
